package com.crb.crm.manage.message.common;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Package: com.gulimall.thrid.party.msg.ctx
 * Description：消息下文配置參數
 * Author: huangjian
 * Date:  2020/7/1 14:57
 * Modified By:
 */
@Data
@Component
@ConfigurationProperties(prefix = "message")
public class MessageCtxConfig {

    private Dingding dingding;

    public  CommonParam config(SMGChannel channel){
        switch (channel){
            case DING_DING:
                return dingding;
            default:
                throw new RuntimeException("渠道【"+channel+"】找不到映射的枚舉，請檢查");
        }
    }

    /**
     * 公共參數
     */
    @Data
    public static class CommonParam {
        private Boolean active;
    }

    @Data
    public static class Dingding extends  CommonParam{
    }

}
